<#assign menu="appUser">
<#assign submenu="appUser_list">
<#include "../../manage/head.ftl">
<style type="text/css">
    .pagination {
        border-radius: 4px;
        display: inline-block;
        margin: 0;
        padding-left: 0;
    }

    .howto, .nonessential, #edit-slug-box, .form-input-tip, .subsubsub {
        color: #666666;
    }

    .subsubsub {
        float: left;
        font-size: 12px;
        list-style: none outside none;
        margin: 8px 0 5px;
        padding: 0;
    }

    .form-group {
        width: 100%;
    }

    .count {
        position: absolute;
        right: 0px;
    }

    .arrticle_status {
        float: left;
    }

    th {
        text-align: center;
    }

    td {
        text-align: center;
    }

    .row {
        margin: 0;
    }
    .search {
        width: 200px;
    }
</style>
<!--main content start-->
<section id="main-content">
    <section class="wrapper">

        <div class="portlet box grey-cascade">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-globe"></i>Managed Table
                </div>
            </div>
            <div class="portlet-body">

                    <table data-toggle="table" class="table table-striped   table-hover dataTable" id="sample_1"
                               aria-describedby="sample_1_info" data-search="true">
                            <thead>
                            <tr role="row">

                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
                                    rowspan="1" colspan="1" aria-label="
									 Username
								: activate to sort column ascending" style="width: 403px;">
                                    用户名
                                </th>
                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
                                    rowspan="1" colspan="1" aria-label="
									 Username
								: activate to sort column ascending" style="width: 403px;">
                                    昵称
                                </th>
                                <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1"
                                    aria-label="Email">
                                    性别
                                </th>
                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample_1"
                                    rowspan="1" colspan="1" aria-label="
									 Points
								: activate to sort column ascending" style="width: 283px;">
                                    签名
                                </th>
                                <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="
									 Joined
								" style="width: 374px;">
                                    是否达人
                                </th>
                                <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1"
                                    style="width: 385px;">
                                    状态
                                </th>
                                <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1"
                                    style="width: 385px;">
                                    操作
                                </th>
                            </tr>
                            </thead>

                            <tbody role="alert" aria-live="polite" aria-relevant="all">
                            <#list pageVo.list as e>
                            <tr class="gradeX odd">

                                <td>
                                ${e.name}
                                </td>
                                <td>
                                ${e.nickname}
                                </td>
                                <td>
                                    <#if e.gender==1> 男</#if>
                                    <#if e.gender==0> 女</#if>
                                </td>
                                <td>${e.signature!}</td>
                                <td class=" ">
                                    <#if e.isDR=0> <span class="label label-sm label-default">否</span></#if>
                                    <#if e.isDR=1><span class="label label-sm label-warning">申请中 </span></#if>
                                    <#if e.isDR=2> <span class="label label-sm label-success">是 </span></#if>
                                </td>
                                <td>
                                    <#if e.authorization==1><span class="label label-sm label-success">在用</span></#if>
                                    <#if e.authorization==0><span class="label label-sm label-default">禁用</span></#if>
                                </td>
                                <td>
                                    <#if e.authorization==1>
                                        <a href="javascript:void(0);" class="js_appUser_delete btn btn-primary"
                                           appUserId="${e.id}"
                                           title="是否禁用此账号">
                                            &nbsp禁用&nbsp
                                        </a>
                                    </#if>

                                    <#if e.authorization==0>
                                        <a href="javascript:void(0);" class="js_appUser_on btn btn-primary"
                                           appUserId="${e.id}"
                                           title="是否启用此账号">
                                            &nbsp启用&nbsp
                                        </a>
                                    </#if>

                                    <#if e.isDR=1>

                                        <a href="javascript:void(0)" class="js_appUser_DRCheck btn btn-primary"
                                           appUserId="${e.id}" title="达人审核">通过达人</a>
                                    </#if>
                                    <#if e.isDR=2>

                                        <a href="javascript:void(0)" class="js_appUser_DRCancel btn btn-primary"
                                           appUserId="${e.id}" title="取消达人">取消达人</a>
                                    </#if>
                                </td>

                            </tr>
                            </#list>
                            </tbody>
                        </table>

                    <div class="row">
                        <div style="height: 30px;">
                            <div class="pagination">${pageVo.pageNumHtml} </div>
                        </div>
                    </div>


            </div>
        </div>
    </section>
</section>


<#include "../../manage/foot.ftl">

<script>

//    jQuery(document).ready(function () {
//        Metronic.init();
//        Layout.init();
//        TableManaged.init();
//    });

    $(function () {
        var pageNum = "${p}";
        $('.js_appUser_delete').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/delete.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });



        $('.js_appUser_on').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/getOn.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_appUser_DRCheck').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/DRCheck.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {
                            alert("失败");
                        }
                    }
                }
            });
        });

        $('.js_appUser_DRCancel').click(function () {
            var appUserId = $(this).attr('appUserId');
            var status = "trash";
            bootbox.dialog({
                message: $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.post("${BASE_PATH}/manage/appUser/DRCancel.json", {"appUserId": appUserId}, function (data) {
                                window.location.reload();
                            }, "json");
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });
    });
</script>


<script src="${BASE_PATH}/static/manage/js/table-managed.js"></script>
